package com.Helper;

import java.sql.*;
import java.util.*;

import com.database.FlightDB;

public class DestHelper 
{
	private static Connection connection = null;
	
	public static void Setup(Connection _connection) throws SQLException
	{
		connection = _connection;
	}
	
	public static ArrayList<FlightInfo> GetAllFlights() throws SQLException
	{
		FlightDB db = new FlightDB();
		db.Setup(connection);
		ArrayList<FlightInfo> list = db.GetAllFlights(null);
		
		return list;
	}
	
	public static FlightInfo GetSelectedFlights(String flightID) throws SQLException
	{
		FlightDB db = new FlightDB();
		db.Setup(connection);
		FlightInfo info = db.GetSelectedFlight(flightID);
		return info;
	}

}
